﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;

namespace PopShops.Entities
{
    public class MerchantQuery : Query
    {
        public int? MerchantID { get; set; }
        public int? MerchantTypeID { get; set; }
        public bool AllMerchants { get; set; }
        public MerchantQuery()
            : base(QueryMethod.Merchant, "merchants", typeof(Merchants))
        {
            AllMerchants = false;
        }


        public override void GenerateParams()
        {
            //Catalog Key
            if (!AllMerchants)
                base.filters.Add("catalog_key", PsContext.Current.CatalogKey);

            //merchant_id
            if (MerchantID.HasValue)
                base.filters.Add("merchant_id", MerchantID.Value.ToString());

            //merchant_type_id
            if (MerchantTypeID.HasValue)
                base.filters.Add("merchant_type_id", MerchantTypeID.Value.ToString());
        }
    }
}
